/*
 * LoginFrame.java
 *
 * Created on Jan 10, 2012, 3:12:08 PM
 */
package kernel_gui.gui.generic.graphic;

import java.awt.AWTError;
import java.awt.Point;
import java.awt.Toolkit;
import kernel_gui.gui.generic.BackGroundPanel;
import kernel_gui.gui.generic.MillionaireFrame;


/**
 *
 * @author Yoyo
 */
public abstract class MainMenuFrame extends MillionaireFrame {

    /**
	 * 
	 */
	private static final long serialVersionUID = 2670771692792885689L;
	
	
	/** Creates new form LoginFrame */
    public MainMenuFrame() {
    	super(false);
        initComponents();
    }

    private void initComponents() {

        LayeredPane = new javax.swing.JLayeredPane();
        LoadingPanel = new javax.swing.JPanel();
        SpinningDollarLabel = new javax.swing.JLabel();
        TopMessageLabel = new javax.swing.JLabel();
        TopMessageLabel1 = new javax.swing.JLabel();
        CancelButton = new javax.swing.JButton();
        MainPanel = new javax.swing.JPanel();
        PlayGameButton = new javax.swing.JButton();
        HallOfFameButton = new javax.swing.JButton();
        MyProfileButton = new javax.swing.JButton();
        ControlPanelButton = new javax.swing.JButton();
        LogoutButton = new javax.swing.JButton();
        ExitButton = new javax.swing.JButton();
        TopHeaderLabel = new javax.swing.JLabel();
        ButtonHeaderLabel = new javax.swing.JLabel();
        AboutButton = new javax.swing.JButton();
        Separator = new javax.swing.JSeparator();
        
        /* My init code */
    	int frameWidth = 148;
    	int frameHeight = 340;
    	this.setIconImage(new javax.swing.ImageIcon("images/Green-Dollar-icon.png").getImage());
    	LayeredPane.setOpaque(false);
    	LoadingPanel.setVisible(false);
    	LoadingPanel.setOpaque(false);
    	setResizable(false);
    	try{
    		Toolkit tk = Toolkit.getDefaultToolkit();
    		int framePosWidth = tk.getScreenSize().width / 2 - frameWidth / 2;
    		int framePosHeight = tk.getScreenSize().height / 2 - frameHeight / 2;
    		Point p = new Point(framePosWidth, framePosHeight);
    		this.setLocation(p);
    		
    	}catch(AWTError e){
    		/*Nothing to do*/
    	}
    	BGPanel = new BackGroundPanel(frameWidth, frameHeight);
        MainPanel = new BackGroundPanel(frameWidth, frameHeight);
    	SpinningDollarLabel.setIcon(new javax.swing.ImageIcon(
    			"images/dollar-spinning.gif")); // NOI18N
    	/* end */
    	
        LoadingPanel.setPreferredSize(new java.awt.Dimension(145, 335));


        TopMessageLabel.setBackground(new java.awt.Color(51, 102, 0));
        TopMessageLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
        TopMessageLabel.setForeground(new java.awt.Color(51, 204, 0));
        TopMessageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopMessageLabel.setText("Loading");
        TopMessageLabel.setOpaque(true);

        TopMessageLabel1.setBackground(new java.awt.Color(51, 102, 0));
        TopMessageLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        TopMessageLabel1.setForeground(new java.awt.Color(51, 204, 0));
        TopMessageLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopMessageLabel1.setText("Please wait");
        TopMessageLabel1.setOpaque(true);

        CancelButton.setFont(new java.awt.Font("Tahoma", 1, 14));
        CancelButton.setText("Cancel");
        CancelButton.setOpaque(false);
        CancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout LoadingPanelLayout = new javax.swing.GroupLayout(LoadingPanel);
        LoadingPanel.setLayout(LoadingPanelLayout);
        LoadingPanelLayout.setHorizontalGroup(
            LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoadingPanelLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(SpinningDollarLabel)
                .addContainerGap(25, Short.MAX_VALUE))
            .addGroup(LoadingPanelLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(TopMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(45, 45, 45))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LoadingPanelLayout.createSequentialGroup()
                .addContainerGap(35, Short.MAX_VALUE)
                .addGroup(LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(CancelButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(TopMessageLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(33, 33, 33))
        );
        LoadingPanelLayout.setVerticalGroup(
            LoadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoadingPanelLayout.createSequentialGroup()
                .addGap(61, 61, 61)
                .addComponent(SpinningDollarLabel)
                .addGap(18, 18, 18)
                .addComponent(TopMessageLabel)
                .addGap(18, 18, 18)
                .addComponent(TopMessageLabel1)
                .addGap(78, 78, 78)
                .addComponent(CancelButton)
                .addContainerGap(44, Short.MAX_VALUE))
        );

        LoadingPanel.setBounds(0, 0, 145, 350);
        LayeredPane.add(LoadingPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MainPanel.setOpaque(false);

        PlayGameButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        PlayGameButton.setText("Play a Game");
        PlayGameButton.setOpaque(false);
        PlayGameButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                PlayGameButtonActionPerformed(evt);
            }
        });

        HallOfFameButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        HallOfFameButton.setText("Hall of Fame");
        HallOfFameButton.setOpaque(false);
        HallOfFameButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                HallOfFameButtonActionPerformed(evt);
            }
        });

        MyProfileButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        MyProfileButton.setText("My Profile");
        MyProfileButton.setOpaque(false);
        MyProfileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MyProfileButtonActionPerformed(evt);
            }
        });

        ControlPanelButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        ControlPanelButton.setText("Control Panel");
        ControlPanelButton.setOpaque(false);
        ControlPanelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ControlPanelButtonActionPerformed(evt);
            }
        });

        LogoutButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        LogoutButton.setText("Logout");
        LogoutButton.setOpaque(false);
        LogoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LogoutButtonActionPerformed(evt);
            }
        });

        ExitButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        ExitButton.setText("Exit");
        ExitButton.setOpaque(false);
        ExitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExitButtonActionPerformed(evt);
            }
        });

        TopHeaderLabel.setFont(new java.awt.Font("Tahoma", 1, 26));
        TopHeaderLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        TopHeaderLabel.setText("Main");

        ButtonHeaderLabel.setFont(new java.awt.Font("Tahoma", 1, 26));
        ButtonHeaderLabel.setText("Menu");

        AboutButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        AboutButton.setText("About");
        AboutButton.setOpaque(false);
        AboutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AboutButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout MainPanelLayout = new javax.swing.GroupLayout(MainPanel);
        MainPanel.setLayout(MainPanelLayout);
        MainPanelLayout.setHorizontalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MainPanelLayout.createSequentialGroup()
                .addGroup(MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(TopHeaderLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(ButtonHeaderLabel, javax.swing.GroupLayout.Alignment.LEADING)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(PlayGameButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(HallOfFameButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(MyProfileButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(ControlPanelButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(AboutButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(ExitButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
                    .addGroup(MainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(Separator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                            .addComponent(LogoutButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))))
                .addContainerGap())
        );
        MainPanelLayout.setVerticalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(TopHeaderLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ButtonHeaderLabel)
                .addGap(18, 18, 18)
                .addComponent(PlayGameButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(HallOfFameButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MyProfileButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ControlPanelButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(AboutButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Separator, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LogoutButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ExitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        MainPanel.setBounds(0, 0, 150, 350);
        LayeredPane.add(MainPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout BGPanelLayout = new javax.swing.GroupLayout(BGPanel);
        BGPanel.setLayout(BGPanelLayout);
        BGPanelLayout.setHorizontalGroup(
            BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 151, Short.MAX_VALUE)
            .addGroup(BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(LayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
        );
        BGPanelLayout.setVerticalGroup(
            BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 348, Short.MAX_VALUE)
            .addGroup(BGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(LayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BGPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BGPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }

    protected abstract void PlayGameButtonActionPerformed(java.awt.event.ActionEvent evt);       

    protected abstract void HallOfFameButtonActionPerformed(java.awt.event.ActionEvent evt);
    
    protected abstract void MyProfileButtonActionPerformed(java.awt.event.ActionEvent evt);

    protected abstract void ControlPanelButtonActionPerformed(java.awt.event.ActionEvent evt);   

    protected abstract void LogoutButtonActionPerformed(java.awt.event.ActionEvent evt);

    protected abstract void ExitButtonActionPerformed(java.awt.event.ActionEvent evt);            

    protected abstract void AboutButtonActionPerformed(java.awt.event.ActionEvent evt);                                    

    protected javax.swing.JButton AboutButton;
    protected javax.swing.JPanel BGPanel;
    protected javax.swing.JLabel ButtonHeaderLabel;
    protected javax.swing.JButton ControlPanelButton;
    protected javax.swing.JButton ExitButton;
    protected javax.swing.JButton HallOfFameButton;
    protected javax.swing.JLayeredPane LayeredPane;
    protected javax.swing.JButton LogoutButton;
    protected javax.swing.JButton MyProfileButton;
    protected javax.swing.JButton PlayGameButton;
    protected javax.swing.JSeparator Separator;
    protected javax.swing.JLabel SpinningDollarLabel;
    protected javax.swing.JLabel TopHeaderLabel;
    protected javax.swing.JLabel TopMessageLabel;
    protected javax.swing.JLabel TopMessageLabel1;
}
